package cn.whuc.homework

object Case03 {
  def main(args: Array[String]): Unit = {
    val strings: Array[String] = Array("hadoop", "spark", "hive", "flume", "zookeeper")
    val list: List[String] = strings.toList
    val tuples: List[(String, Int)] = list.map(word => {
      (word, word.length)
    })
    val tuples1: List[(String, Int)] = tuples.sortBy(_._2).reverse

    val stringToInts: List[Map[String, Int]] = tuples1.map(t => {
      Map(t)
    })

    println(stringToInts)
  }
}
